<div class="modal-header">
    <h3 class="modal-title">服务映射配置</h3>
</div>
<div class="modal-body">
    <form class="bs-example form-horizontal">
        <div class="form-group">
            <div class="col-md-6">
                <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>服务器组名称</label>
                <div class="col-lg-8">
                    <ui-select ng-model="nowServerGroup.selected" theme="bootstrap" ng-change="doChange()"
                               ng-change="changeServerGroup(nowServerGroup.selected)">
                        <ui-select-match placeholder="搜索服务器组名称......">{{$select.selected.name}}</ui-select-match>
                        <ui-select-choices refresh="queryServerGroup($select.search)" refresh-dalay="0"
                                           repeat="item in serverGroupList | filter: $select.search">
                            <div ng-bind-html="item.name | highlight: $select.search"></div>
                        </ui-select-choices>
                    </ui-select>
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-6">
                <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>环境类型</label>
                <div class="col-lg-8">
                    <select class="form-control" ng-model="nginxTcp.envType" ng-change="doChange()"
                            ng-options="envItem.code as envItem.name for envItem in envType" required>
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div>
            <div class="col-md-6">
                <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>端口名称</label>
                <div class="col-lg-8">
                    <select class="form-control" ng-model="nginxTcp.portName" ng-change="doChange()"
                            ng-options="portName.code as portName.name for portName in servicePortType" required>
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-6">
                <label class="col-lg-4 control-label">服务名称</label>
                <div class="col-lg-8">
                    <input type="text" class="form-control" required ng-disabled="true"
                           ng-model="nginxTcp.serviceName">
                </div>
            </div>

            <div class="col-md-6">
                <label class="col-lg-4 control-label">映射端口</label>
                <div class="col-lg-8">
                    <input type="text" class="form-control"  required ng-disabled="true"
                           ng-model="nginxTcp.nginxPort">
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-6" ng-show="nginxTcp.serviceName != '' && nginxTcp.id == 0">
                <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>有效期</label>
                <div class="col-lg-8">
                    <select class="form-control" ng-model="nginxTcp.period"
                            ng-options="period.code as period.name for period in nginxTcpPeriod" required>
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-2 control-label">说明</label>
            <div class="col-lg-10">
                <textarea class="form-control" cols="3" ng-model="nginxTcp.content"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div style="text-align:center;">
                <!--保存-->
                <button ng-show="nginxTcp.serviceName != '' && nginxTcp.id == 0"
                        ng-click="createNginxTcp()"
                        class="btn btn-xs"
                        style="background-color: #2e6da4; color: white;">
                    <i class="fa fa-spin fa-spinner" ng-show="btnSaveing"></i>
                    <span class="icon icon-feed"></span>开启映射
                </button>


                <button class="btn btn-xs"
                        style="margin-left: 5px; background-color: #ff8700; color: white;"
                        ng-click="closeModal()">关闭
                </button>

            </div>
        </div>
    </form>

    <div>
        <div ng-include="'tpl/modal/public/pub_alert.html'"></div>
    </div>
</div>